package cn.lyjuan.aliyun.mq.conf.config;

import cn.lyjuan.aliyun.mq.conf.java.conf.MQAuthCst;
import cn.lyjuan.aliyun.mq.conf.java.dynamic.MQConsumerImplTest;
import com.aliyun.openservices.ons.api.MessageListener;
import org.springframework.beans.factory.config.PropertiesFactoryBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;

import java.util.Properties;
import java.util.UUID;

/**
 * Created by chad on 2016/10/12.
 */
@Configuration
public class RootConfig
{
    @Bean
    public PropertiesFactoryBean mqAuthPro()
    {
        PropertiesFactoryBean mqAuthPro = new PropertiesFactoryBean();
        mqAuthPro.setLocation(new ClassPathResource("cst/mqAuthCst-test.properties"));
        return mqAuthPro;
    }

    @Bean(name = MQAuthCst.QUITE_BEAN_NAME)
    public MQAuthCst mqAuthCst(Properties mqAuthPro)
    {
        return new MQAuthCst(mqAuthPro);
    }



//    @Bean
//    public MessageListener mqUserMessageListener()
//    {
//        return new MQConsumerImplTest.MQMessageListener();
//    }
}
